<template>
	<view class="box">
		<view class="" v-if="dataList.length > 0">
			<template v-for="(item, index) in dataList">
				<view class="height_12">
					
				</view>
				<view class="info_box box width_351 height_133 ml_12 mr_12 br_8 bc_fff">
					<view class="info_top w100 height_64">
						<view class="top_left">
							<view class="width_40 height_40 br_42 photo_view_box">
								<image class="user_avatar" :src="item.avatar ? item.avatar : ossUrl + '/avatar_empty.png'"
									mode=""></image>
							</view>
							<view class="fz_16 ml_12 mr_4 fc_333 user_name_box">
								{{ item.nickName }}
							</view>
							<image :src="ossUrl + '/info_' + item.memberLevel + '.png'" class="width_88 height_22" mode="">
							</image>
						</view>
						<view class="top_right fz_12 fc_999">
							{{ item.registerTime }}
						</view>
					</view>
					<view class="info_bottom w100 height_69">
						<view class="bottom_left">
							<view class="number fz_16 fb mb-6">
								¥{{ item.accountInfo.totalEnterprise || 0 }}
							</view>
							<view class="fz_12 fc_333">
								消费总额
							</view>
						</view>
						<view class="bottom_right width_112 height_40 br_112 fz_14 fc_fff" @click="bindPhoneCall(item.phone)">
							<image  class="width_16 height_16" src="../../../../static/images/invite_phone_icon.png" mode=""></image>
							<view class="ml_8">
								联系会员
							</view>
						</view>
					</view>
				</view>
			</template>
		</view>
		<Empty v-else :isInvite="true" :isRequest="isRequest"></Empty>
		<view class="height_19">
			
		</view>
	</view>
</template>

<script>
import Empty from "./empty.vue"
export default {
	components: {
		Empty
	},
	props: {
		dataList: {
			type: Array,
			default: function () {
				return []
			}
		},
		ossUrl: {
			type: String,
			default: ""
		},
		isRequest: {
			type: Boolean,
			default: false
		}
	},
	mounted() {
		setTimeout(() => {

			console.log("邀请数据")
			console.log(this.dataList)
			console.log(this.dataList[0])
		}, 1000)
	},
	data() {
		return {}
	},
	methods:{
		bindPhoneCall(phoneNumber) {
			uni.makePhoneCall({
				phoneNumber:phoneNumber,
				success() {
					
				},
				fail() {
					
				}
			})
		}
	}
}
</script>

<style lang="scss" scoped>
.member_header {

	@include flex_box(row, nowrap, space-between, center);

	.header_left {
		@include set_padding(0rpx, 15rpx);
		@include flex_box(row, nowrap, center, center);
	}

	.header_right {
		@include flex_box(row, nowrap, center, center);
		border-left: 1rpx solid rgba(0, 0, 0, 0.1);
		;
	}
}

.info_box {
	@include set_padding(0rpx, 12rpx);

	.info_top {
		border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
		@include flex_box(row, nowrap, space-between, center);

		.top_left {
			@include flex_box(row, nowrap, flex-start, center);
		}
	}

	.photo_view_box {
		overflow: hidden;

		image {
			width: 100%;
			height: 100%;
			display: block;
		}
	}

	.user_name_box {
		max-width: 112rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.info_bottom {
		@include flex_box(row, nowrap, space-between, center);

		.bottom_left {
			@include flex_box(column, nowrap, flex-start, flex-start);

			.number {
				color: #FE5A1C;
			}
		}

		.bottom_right {
			@include flex_box(row, nowrap, center, center);
			background-color: #F08519;
			width: 224rpx;
			height: 80rpx;
			background: #F08519;
			border-radius: 2000rpx 2000rpx 2000rpx 2000rpx;
		}
	}
}
</style>